home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmClipData
- BackColor = &H00C0C0C0&
- Caption = "The ClipData Program"
- ClientHeight = 4020
- ClientLeft = 1545
- ClientTop = 1815
- ClientWidth = 7365
- Height = 4710
- Icon = CLIPDATA.FRX:0000
- Left = 1485
- LinkTopic = "Form1"
- ScaleHeight = 4020
- ScaleWidth = 7365
- Top = 1185
- Width = 7485
- Begin ListBox lstMyList
- Height = 1005
- Left = 3720
- TabIndex = 3
- Top = 2760
- Width = 3375
- End
- Begin ComboBox cboMyCombo
- BackColor = &H00C0C0C0&
- Height = 300
- Left = 240
- TabIndex = 2
- Top = 2760
- Width = 3015
- End
- Begin TextBox txtMyTextBox
- Height = 2415
- Left = 240
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 1
- Top = 240
- Width = 3015
- End
- Begin PictureBox picMyPicture
- Height = 2415
- Left = 3720
- ScaleHeight = 2385
- ScaleWidth = 3345
- TabIndex = 0
- Top = 240
- Width = 3375
- End
- Begin Menu mnuFile
- Caption = "&File"
- Begin Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin Menu mnuEdit
- Caption = "&Edit"
- Begin Menu mnuCopy
- Caption = "&Copy"
- End
- Begin Menu mnuCut
- Caption = "C&ut"
- End
- Begin Menu mnuPaste
- Caption = "&Paste"
- End
- End
- Option Explicit
- Sub Form_Load ()
- ' Fill items inside the list control
- lstMyList.AddItem "This is item 1 in the list"
- lstMyList.AddItem "This is item 2 in the list"
- lstMyList.AddItem "This is item 3 in the list"
- lstMyList.AddItem "This is item 4 in the list"
- lstMyList.AddItem "This is item 5 in the list"
- lstMyList.AddItem "This is item 6 in the list"
- ' Fill items inside the combo box control
- cboMyCombo.AddItem "This is item 1 in the combo box"
- cboMyCombo.AddItem "This is item 2 in the combo box"
- cboMyCombo.AddItem "This is item 3 in the combo box"
- cboMyCombo.AddItem "This is item 4 in the combo box"
- cboMyCombo.AddItem "This is item 5 in the combo box"
- cboMyCombo.AddItem "This is item 6 in the combo box"
- End Sub
- Sub mnuCopy_Click ()
- ' Clear the clipboard
- Clipboard.Clear
- ' Copy the contents of the currently active
- ' control to the clipboard.
- If TypeOf Screen.ActiveControl Is TextBox Then
- Clipboard.SetText Screen.ActiveControl.SelText
- ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
- Clipboard.SetText Screen.ActiveControl.Text
- ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
- Clipboard.SetData Screen.ActiveControl.Picture
- ElseIf TypeOf Screen.ActiveControl Is ListBox Then
- Clipboard.SetText Screen.ActiveControl.Text
- Else
- ' Don't perform the Copy operation
- ' because there isn't any control with
- ' the focus.
- End If
- End Sub
- Sub mnuCut_Click ()
- ' Do the Copy operation
- mnuCopy_Click
- ' Copy the contents of the currently active
- ' control to the clipboard.
- If TypeOf Screen.ActiveControl Is TextBox Then
- Screen.ActiveControl.SelText = ""
- ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
- Screen.ActiveControl.Text = ""
- ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
- Screen.ActiveControl.Picture = LoadPicture()
- ElseIf TypeOf Screen.ActiveControl Is ListBox Then
- If Screen.ActiveControl.ListIndex >= 0 Then
- Screen.ActiveControl.RemoveItem Screen.ActiveControl.ListIndex
- End If
- Else
- ' Don't perform the Cut operation
- ' because there isn't any control with
- ' the focus.
- End If
- End Sub
- Sub mnuExit_Click ()
- End
- End Sub
- Sub mnuPaste_Click ()
- ' Paste the contents of the clipboard to the
- ' currently active control.
- If TypeOf Screen.ActiveControl Is TextBox Then
- Screen.ActiveControl.SelText = Clipboard.GetText()
- ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
- Screen.ActiveControl.Text = Clipboard.GetText()
- ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
- Screen.ActiveControl.Picture = Clipboard.GetData()
- ElseIf TypeOf Screen.ActiveControl Is ListBox Then
- Screen.ActiveControl.AddItem Clipboard.GetText()
- Else
- ' Don't perform the Copy operation
- ' because there isn't any control with
- ' the focus.
- End If
- End Sub
- Sub picMyPicture_GotFocus ()
- ' When the picture control gets the focus
- ' change its border (so that the reader will
- ' be able to see that this control now
- ' has the focus).
- picMyPicture.BorderStyle = 1
- End Sub
- Sub picMyPicture_LostFocus ()
- ' When the picture control looses the focus
- ' change its border (so that the reader will
- ' be able to see that this control now
- ' lost the focus).
- picMyPicture.BorderStyle = 0
- End Sub
-